﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessLogicLayer
{
    public class clsFinance
    {
        #region Properties
        public DateTime DateCreated { get; set; }
        public DateTime DateChanged { get; set; }
        public String UserCreated { get; set; }
        public String UserChanged { get; set; }
        public Int32 ID { get; set; }
        private DateTime DateConcerned { get; set; }
        public Double Amount { get; set; }
        public String Description { get; set; }
        public clsCurrency Currency { get; set; }
        #endregion

        #region Constructors
        #endregion

        #region Events
        #endregion

        #region Public Methods
        /// <summary>
        /// Returns the date concerned.
        /// </summary>
        /// <returns></returns>
        public DateTime GetDateConcerned()
        {
            return this.DateConcerned;
        }

        /// <summary>
        /// Set the date concerned.
        /// </summary>
        /// <param name="pYear"></param>
        /// <param name="pMonth"></param>
        /// <param name="pDay"></param>
        /// <param name="pHour"></param>
        /// <param name="pMinute"></param>
        public void SetDateConcerned(Int32 pYear, Int32 pMonth, Int32 pDay, Int32 pHour, Int32 pMinute)
        {
            DateTime ConvertedDate;
            String TimeString = pYear + "-" + pMonth + "-" + pDay + " " + pHour + ":" + pMinute;
            if (DateTime.TryParse(TimeString, out ConvertedDate))
            {
                this.DateConcerned = ConvertedDate;
            }
            else
            {
                throw new ArgumentException("Error 13: Could not convert date.");
            }
        }

        /// <summary>
        /// Set the date concerned.
        /// </summary>
        /// <param name="pYear"></param>
        /// <param name="pMonth"></param>
        /// <param name="pDay"></param>
        /// <param name="pHour"></param>
        /// <param name="pMinute"></param>
        public void SetDateConcerned(DateTime pDateConcerned)
        {
            this.DateConcerned = pDateConcerned;
        }
        #endregion

        #region Private Methods
        #endregion
    }
}
